<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <div :style="{ fontSize: postFontSize + 'em' }">
            <blog-post v-for="post in posts" v-bind:key="post.id" v-bind:post="post"></blog-post>
        </div>
    </div>

    <script src="./vue.js"></script>

    <script>
        Vue.component('blog-post', {
            props: ['post'],
            template: `
            <div class="blog-post">
                <h3>{{post.title}}</h3>
                <button v-on:click="$emit('enlarge-text')">
  Enlarge text
</button>
                    <div v-html="post.content"></div>
            </div>`
        })
        // Vue.component('post',{
        //     props:['title'],
        //     template:'<h2>{{title}}</h2>'
        // })
        var app = new Vue({
            el: '#app',
            data: {
                postFontSize: 1,
                id: 1,

                title: '6.7'
            }
        })
    </script>
</body>

</html>